package cn.alusiaor.nacosdiscoveryclientprovider.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: zhuzhiping
 * @Description: 配置测试
 * @Date: 2020/8/21 11:04
 */
@RestController
@RefreshScope
@Slf4j
public class TestController {

    @Value("${message:null}")
    private String message;

    @GetMapping("/message")
    public String getMessage() {
        return this.message;
    }

    @GetMapping("/hello")
    public String hello(@RequestParam("name") String name) {
        log.info("provider:{}", name);
        return name;
    }
}
